/**
 * 
 */
package design_pattern.interpreter;

import java.util.HashMap;

/**
 * @author linzq
 * 
 */
public class Context {

  private HashMap map = new HashMap();

  public void asign(Variable var, boolean value) {
    map.put(var, value);
  }

  public boolean lookup(Variable var) throws IllegalArgumentException {
    Boolean value = (Boolean) map.get(var);
    if (value == null) {
      throw new IllegalArgumentException();
    }
    return value.booleanValue();
  }

}
